
<link href="__LIBS__/bootstrap-table/bootstrap-table.min.css" type="text/css" rel="stylesheet">

<div id="toolbar">
    <button title="发送站内信" target-form="ids" icon="fa fa-trash" class="btn btn-primary btn-sm" onclick="rmFromGroup()" primary-key="uid">
        <i class="fa fa-envelope-o fa-fw"></i>发送站内信</button>&nbsp;
</div>

<!-- 数据列表 -->
<div class="col-md-3 col-lg-3 col-sm-3">
    <div class="box box-danger">
        <div class="box-header with-border">
            <h5 class="box-title">在线用户:{$num} 人</h5>
        </div>
        <div class="box-body">
            <table class="bootstrap-table" id="mytable"></table>
        </div>
    </div>
</div>

   

    <script type="text/javascript" src="__LIBS__/bootstrap-table/bootstrap-table.min.js"></script>
    <script type="text/javascript" src="__LIBS__/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
    <script type="text/javascript">
       // group_id = $('#group_id').val();
        $('#mytable').bootstrapTable({
            data: {$data},
            pagination: true,
            dataField: 'total',
            pageList: [10, 20 ,50],
            columns: [
                {
                    checkbox: true
                },
                {
                    field: 'nickname',
                    title: '名称'
                },
                {
                    field:'school',
                    title:'院系'
                },
                // {
                //     field:'pro_title',
                //     title:'职称'
                // },
                {
                    field:'login',
                    title:'在线',
                    formatter:function (value) {
                        var state
                        if(!value)
                            state= "<span class='badge bg-red' style='padding:5px 10px;'>离线</span>";
                        else
                            state= "<span class='badge bg-green'  style='padding:5px 10px;'>在线</span>";
                        return state;
                    }
                }
            ],
            height: 560,
            search: true,
            showColumns: true,
            showToggle: true,
            idFieldId: 'uid',
            clickToSelect: true,
            toolbar: '#toolbar'
        })
    
    </script> 





